package cn.sdxx.qddata.mapper;


import cn.sdxx.qddata.entity.Joke;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface JokeMapper extends BaseMapper<Joke> {

    @Select("select *  FROM  t_joke  where  id  in  (" +
            "select  t.id  from  (" +
            "select id from t_joke  ORDER BY RAND() limit #{num} )  as  t );")
    List<Joke> getJokesRandom(Integer num);
}
